class Solution:
    def isAnagram(self, s: str, t: str) -> bool:
        #长度不等返回false
        #使用map记录
        #看值最后是否会被消掉
        if len(s)!=len(t):
            return False

        m={}
        for i in s:
            if i in m:
                m[i]+=1
            else:
                m[i]=1
        for j in t:
            if j in m:
                m[j]-=1
            else:
                return False
        for a in m:
            if m[a]!=0:
                return False
                
        return True
            